package com.sunshine.session;

import com.sunshine.builder.xml.XMLConfigBuilder;
import com.sunshine.session.defaults.DefaultSqlSessionFactory;

import java.io.Reader;

/**
 * @author Mokairui
 * @description
 * @since 2022/10/30
 */
public class SqlSessionFactoryBuilder {
    
    public SqlSessionFactory build(Reader reader) {
        XMLConfigBuilder xmlConfigBuilder = new XMLConfigBuilder(reader);
        return build(xmlConfigBuilder.parse());
    }
    
    public SqlSessionFactory build(Configuration config) {
        return new DefaultSqlSessionFactory(config);
    }
    
}
